home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / creat.man < prev    next >
Encoding:
Text File  |  1989-01-25  |  4.4 KB  |  199 lines

  1.  
  2.  
  3.  
  4. CREAT                 C Library Procedures                  CREAT
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      creat - create a new file
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ccrreeaatt((nnaammee,, mmooddee))
  13.      cchhaarr **nnaammee;;
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      TThhiiss iinntteerrffaaccee iiss mmaaddee oobbssoolleettee bbyy ooppeenn((22))..
  17.  
  18.      _C_r_e_a_t creates a new file or prepares to rewrite an existing
  19.      file called _n_a_m_e, given as the address of a null-terminated
  20.      string.  If the file did not exist, it is given mode _m_o_d_e,
  21.      as modified by the process's mode mask (see _u_m_a_s_k(2)).  Also
  22.      see _c_h_m_o_d(2) for the construction of the _m_o_d_e argument.
  23.  
  24.      If the file did exist, its mode and owner remain unchanged
  25.      but it is truncated to 0 length.
  26.  
  27.      The file is also opened for writing, and its file descriptor
  28.      is returned.
  29.  
  30. NNOOTTEESS
  31.      The _m_o_d_e given is arbitrary; it need not allow writing.
  32.      This feature has been used in the past by programs to con-
  33.      struct a simple, exclusive locking mechanism.  It is
  34.      replaced by the O_EXCL open mode, or _f_l_o_c_k(2) facility.
  35.  
  36. RREETTUURRNN VVAALLUUEE
  37.      The value -1 is returned if an error occurs.  Otherwise, the
  38.      call returns a non-negative descriptor that only permits
  39.      writing.
  40.  
  41. EERRRROORRSS
  42.      _C_r_e_a_t will fail and the file will not be created or trun-
  43.      cated if one of the following occur:
  44.  
  45.      [ENOTDIR]      A component of the path prefix is not a
  46.                     directory.
  47.  
  48.      [EINVAL]       The pathname contains a character with the
  49.                     high-order bit set.
  50.  
  51.      [ENAMETOOLONG] A component of a pathname exceeded 255 char-
  52.                     acters, or an entire path name exceeded 1023
  53.                     characters.
  54.  
  55.      [ENOENT]       The named file does not exist.
  56.  
  57.      [ELOOP]        Too many symbolic links were encountered in
  58.                     translating the pathname.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 22, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CREAT                 C Library Procedures                  CREAT
  71.  
  72.  
  73.  
  74.      [EACCES]       Search permission is denied for a component
  75.                     of the path prefix.
  76.  
  77.      [EACCES]       The file does not exist and the directory in
  78.                     which it is to be created is not writable.
  79.  
  80.      [EACCES]       The file exists, but it is unwritable.
  81.  
  82.      [EISDIR]       The file is a directory.
  83.  
  84.      [EMFILE]       There are already too many files open.
  85.  
  86.      [ENFILE]       The system file table is full.
  87.  
  88.      [ENOSPC]       The directory in which the entry for the new
  89.                     file is being placed cannot be extended
  90.                     because there is no space left on the file
  91.                     system containing the directory.
  92.  
  93.      [ENOSPC]       There are no free inodes on the file system
  94.                     on which the file is being created.
  95.  
  96.      [EDQUOT]       The directory in which the entry for the new
  97.                     file is being placed cannot be extended
  98.                     because the user's quota of disk blocks on
  99.                     the file system containing the directory has
  100.                     been exhausted.
  101.  
  102.      [EDQUOT]       The user's quota of inodes on the file system
  103.                     on which the file is being created has been
  104.                     exhausted.
  105.  
  106.      [EROFS]        The named file resides on a read-only file
  107.                     system.
  108.  
  109.      [ENXIO]        The file is a character special or block spe-
  110.                     cial file, and the associated device does not
  111.                     exist.
  112.  
  113.      [ETXTBSY]      The file is a pure procedure (shared text)
  114.                     file that is being executed.
  115.  
  116.      [EIO]          An I/O error occurred while making the direc-
  117.                     tory entry or allocating the inode.
  118.  
  119.      [EFAULT]       _N_a_m_e points outside the process's allocated
  120.                     address space.
  121.  
  122.      [EOPNOTSUPP]   The file was a socket (not currently imple-
  123.                     mented).
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 22, 1986                          2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CREAT                 C Library Procedures                  CREAT
  137.  
  138.  
  139.  
  140. SSEEEE AALLSSOO
  141.      open(2), write(2), close(2), chmod(2), umask(2)
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0               May 22, 1986                          3
  196.  
  197.  
  198.  
  199.